package com.ruoyi.StarStudio.DAO;

import com.ruoyi.StarStudio.Entity.PanicBuyingOrders;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface PanicBuyingOrdersDAO {

    List<PanicBuyingOrders> findPanicBuyingOrdersList(PanicBuyingOrders panicBuyingOrders);

    @Select("select count(panic_buying_order_id) from panic_buying_orders")
    long findTotalRecord();

    @Insert("insert into panic_buying_orders values (null,#{user_id},#{order_id},#{goods_id},#{coupons_id},#{del_flag})")
    @Options(useGeneratedKeys = true,keyProperty = "panic_buying_order_id",keyColumn = "panic_buying_order_id")
    void addPB_order(PanicBuyingOrders panicBuyingOrders);
}
